#!/bin/bash

# 安装目录
INSTALL_DIR="/usr/local/bin"
BINARY_NAME="gitlog"

echo
echo "============================================================"
echo "Uninstalling ${BINARY_NAME}..."
echo "============================================================"

# 删除主程序
echo "Removing main program..."
if [ -f "$INSTALL_DIR/${BINARY_NAME}" ]; then
    sudo rm -f "$INSTALL_DIR/${BINARY_NAME}"
    if [ $? -ne 0 ]; then
        echo "Failed to remove ${BINARY_NAME}"
        exit 1
    fi
else
    echo "Main program not found"
fi

# 删除别名
echo "Removing aliases..."
if [ -f "$INSTALL_DIR/glb" ]; then
    sudo rm -f "$INSTALL_DIR/glb"
    if [ $? -ne 0 ]; then
        echo "Failed to remove glb"
        exit 1
    fi
else
    echo "Alias not found"
fi

echo
echo "============================================================"
echo "Uninstallation completed!"
echo "============================================================" 